package com.yystar.support.clock.service.impl;

import java.util.Date;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.yystar.support.clock.dao.ClockDao;
import com.yystar.support.clock.service.ClockService;

@Service("clockService")
public class ClockServiceImpl implements ClockService {
	@Resource
	private ClockDao clockDao;

	public Date getCurrentDatabaseDateTime() {
		Date result = new Date();
		result.setTime(result.getTime() - clockDao.getCurrentClock().getDiff());
		return result;
	}
}
